//
//  UIButton+BackgroundColorWithState.h
//  LeTu
//
//  Created by xianquan on 15/4/22.
//
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, GradientType) {
    GradientTypeTopToBottom = 0,//从上到下
    GradientTypeLeftToRight = 1,//从左到右
    GradientTypeUpleftTolowRight = 2,//左上到右下
    GradientTypeUprightTolowLeft = 3,//右上到左下
};

@interface UIButton (BackgroundColorWithState)
- (void)setBackgroundColor:(UIColor *)backgroundColor forState:(UIControlState)state;
-(void)setbackgroundGradientImageWithColors:(NSArray<UIColor*>*)colorArray gradientType:(GradientType)gradientType forState:(UIControlState)state;
@end

@interface UIImage (GradientColor)
/*
 渐变色
 !@brief 建议颜色设置为2个相近色为佳，设置3个相近色能形成拟物化的凸起感
 view必须设置
 */
+ (UIImage*) gradientImageFromColors:(NSArray<UIColor*>*)colors gradientType:(GradientType)gradientType inSize:(CGSize)size;

- (UIImage *)resizewithQuality:(CGInterpolationQuality)quality
                    rate:(CGFloat)rate;
@end

